Mapping Input Fields in User Expressions
Expressions in input mapping fields are similar to flow training phrases; the difference is that the bot uses them at a flow step level. Users chatting with a DRUID bot can provide information in the form of expressions, not only exact-match responses. In order for bots to extract information when the user answers with an expression, bot authors can define training phrases on flow steps of type Prompt to provide the bot with alternative ways for capturing user input.
To map input fields in user expressions on Prompt steps, click the Training Phrases section and add variations of what the user might answer in the chat. Each training phrase on the step should contain the entity provided on the step in the Input Mapping field (General section).
Multiple Inputs in user expressions
In DRUID version 1.74 and higher, you can provide multiple entity fields in a training phrase on a flow step. DRUID Machine Learning extractor identifies multiple values, but the Flow Engine only sets within the conversation context the one associated to the entity field mentioned in input mapping on the flow step. For example:
Bot: "What do you want to order?"
User: "I would like 3 bottles of Cola, please".
To address the example above, we have a flow step with [[Product]].Name in input mapping and with the following training phrase:"I would like [[Product].Qty [[Product]].Unit of [[Product]].Name, please".
NER will extract from user input multiple records and the Flow Engine will store the extracted values in the appropriate entity fields (the ones provided in training phrases).
If the Flow Engine extracts the value of at least one entity field provided in the training phrase but not the one from Input mapping, the bot keeps the user in the loop, raising the special message "InputValueInterpretationError".
If the Flow Engine does not extract any value, it proceeds to data validation. If the data is string, the Flow Engine sets the user input in the entity provided in Input mapping; otherwise, it proceeds to child intents, intent switch, etc.).
Test training phrases on flow steps
You can test the training phrases on the flow step by entering an expression and clicking the Test icon and selecting the desired bot language.
Below the test area, you will see the information bot extracted in the entity provided in Input mapping (and in the step training phrases).